package com.example.volleyball;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import androidx.appcompat.app.AppCompatActivity;

import com.example.volleyball.Tools.CustomDialog;

public class ChangdiActivity extends AppCompatActivity {
    public static String field;
    CustomDialog dialog;
    private Button btn_xl1; // 返回按钮
    private Button button1, button2, button3, button4; // 四个场地预约按钮

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_changdi);
        init();
        btn_xl1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                //创建Intent 对象
                Intent intent = new Intent(ChangdiActivity.this, Classification.class);
                //启动Activity
                startActivity(intent);
            }
        });
        button1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                field = "标准室内排球场-A";
                dialog();
            }
        });

        button2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                field = "豪华室内排球场-B";
                dialog();
            }
        });

        button3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                field = "标准室外排球场-A";
                dialog();
            }
        });

        button4.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                field = "休闲室内排球场-B";
                dialog();
            }
        });
    }

    private void init() {
        dialog = new CustomDialog(ChangdiActivity.this);
        btn_xl1 = findViewById(R.id.btn_xl);    // 返回键
        button1 = findViewById(R.id.button1);
        button2 = findViewById(R.id.button2);
        button3 = findViewById(R.id.button3);
        button4 = findViewById(R.id.button4);
    }

    private void dialog() {

        dialog.show();
    }
}

